﻿<UserControl x:Class="FXC.SL.UserControls.InstantMarketQuoteGrid"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
    xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
    
    <Grid x:Name="LayoutRoot" Background="White">
        <sdk:DataGrid x:Name="dgMarketQuote" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalScrollBarVisibility="Visible" ItemsSource="{Binding Items, Source={StaticResource InstantMarketQuoteViewModal}}" MouseRightButtonDown="dgMarketQuote_MouseRightButtonDown">
            <sdk:DataGrid.Columns>
                <sdk:DataGridTemplateColumn Header="商品" HeaderStyle="{StaticResource DGHeaderText}" Width="*">
                    <sdk:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal" Margin="5,0">
                                <Image Source="{Binding IsRise, Converter={StaticResource InstantMarketQuoteImagePathConverter}}" Width="12" Height="13" />
                                <TextBlock Text="{Binding ProductName, Mode=TwoWay}" Margin="5,0" />
                            </StackPanel>
                        </DataTemplate>
                    </sdk:DataGridTemplateColumn.CellTemplate>
                </sdk:DataGridTemplateColumn>

                <sdk:DataGridTemplateColumn Header="卖价" HeaderStyle="{StaticResource DGHeaderText}" Width="70">
                    <sdk:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding SellPrice, Mode=TwoWay}" HorizontalAlignment="Right" Margin="3,0" Foreground="{Binding IsRise, Converter={StaticResource InstantMarketQuoteForgroundColorConverter}}"/>
                        </DataTemplate>
                    </sdk:DataGridTemplateColumn.CellTemplate>
                </sdk:DataGridTemplateColumn>

                <sdk:DataGridTemplateColumn Header="买价" HeaderStyle="{StaticResource DGHeaderText}" Width="70">
                    <sdk:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding BuyPrice, Mode=TwoWay}" HorizontalAlignment="Right" Margin="3,0" Foreground="{Binding IsRise, Converter={StaticResource InstantMarketQuoteForgroundColorConverter}}"/>
                        </DataTemplate>
                    </sdk:DataGridTemplateColumn.CellTemplate>
                </sdk:DataGridTemplateColumn>
            </sdk:DataGrid.Columns>
            <telerikNavigation:RadContextMenu.ContextMenu>
                <telerikNavigation:RadContextMenu>
                    <telerikNavigation:RadMenuItem x:Name="rmiNewChart" Header="图表窗口" Click="rmiNewChart_Click"/>
                    <telerikNavigation:RadMenuItem Header="即时图" />
                    <telerikNavigation:RadMenuItem IsSeparator="True" />
                    <telerikNavigation:RadMenuItem Header="隐藏" />
                    <telerikNavigation:RadMenuItem Header="隐藏全部" />
                    <telerikNavigation:RadMenuItem Header="显示全部" />
                    <telerikNavigation:RadMenuItem Header="商品列表" />
                    <telerikNavigation:RadMenuItem IsSeparator="True" />
                    <telerikNavigation:RadMenuItem Header="时间" />
                    <telerikNavigation:RadMenuItem Header="自动排列" />
                    <telerikNavigation:RadMenuItem Header="网格" />
                    <telerikNavigation:RadMenuItem IsSeparator="True" />
                    <telerikNavigation:RadMenuItem Header="弹出报价" />
                </telerikNavigation:RadContextMenu>
            </telerikNavigation:RadContextMenu.ContextMenu>
        </sdk:DataGrid>
    </Grid>
</UserControl>
